﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Kay.Music.Attribute;

namespace Kay.Music.Player
{
    public partial class AlterAttribute : Form
    {
        public MediaObject MediaObject { get; set; }

        public AlterAttribute(string path)
        {
            InitializeComponent();
            MediaObject = new MediaObject(path);
        }

        private void Init()
        {
            textBox_Title.Text = MediaObject.Tags.Title;
            textBox_SubTitle.Text = MediaObject.Tags.SubTitle;
            textBox_Rating.Text = MediaObject.Tags.Rating.ToString();
            textBox_Comment.Text = MediaObject.Tags.Comment;
            textBox_Author.Text = MediaObject.Tags.Author;
            textBox_AlbumTitle.Text = MediaObject.Tags.AlbumTitle;
            textBox_AlbumArtist.Text = MediaObject.Tags.AlbumArtist;
            textBox_Year.Text = MediaObject.Tags.Year.ToString();
            textBox_Genre.Text = MediaObject.Tags.Genre;
            textBox_TrackNumber.Text = MediaObject.Tags.TrackNumber.ToString();
            textBox_Duration.Text = MediaObject.Tags.Duration;
            textBox_BitRate.Text = MediaObject.Tags.BitRate;
        }

        private void AlterAttribute_Load(object sender, EventArgs e)
        {
            Init();
        }
    }
}
